import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'package:tencent_calls_engine/tuicall_observer.dart';

import 'platform/tuicall_engine_platform_interface.dart';

class TUICallEngine extends PlatformInterface {
  TUICallEngine() : super(token: _token);

  static final Object _token = Object();

  static TUICallEngine _instance = TUICallEngine();

  static TUICallEngine get instance => _instance;

  static set instance(TUICallEngine instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<void> addObserver(TUICallObserver observer) async {
    await TUICallEnginePlatform.instance.addObserver(observer);
  }

  Future<void> removeObserver(TUICallObserver observer) async {
    await TUICallEnginePlatform.instance.removeObserver(observer);
  }
}
